import Vue from 'vue'

const component = {
    template: `
    <div>
     123
     <span v-show='active'>show method</span>
     <span >{{propOne}}</span>
     <button @click='changeMethod'>test</button>
    </div>`,
    props: {

        active: Boolean,
        propOne: String,
        onChange: Function

    },
    mounted() {
        // this.propOne = '123'
    },
    methods: {
        changeMethod() {
            console.log(1111)
            this.$emit('change', 1)
        }
    },
    data() {
        return {
            text: 0
        }
    }
}

// Vue.component('CompOne', component)

new Vue({
    components: {
        CompOne: component
    },
    mounted() {
        // this.$on('test', (a) => {
        //     console.log(a);
        // })
    },
    methods: {
        changeMethod(a) {
            console.log(a)
        }
    },
    el: '#app',
    template: "<div><comp-one  :active='true'></comp-one><comp-one :active='false' @change='changeMethod' prop-one='123123'></comp-one></div>"
})
